package com.wzh.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
    @TableId(type=IdType.ID_WORKER)
    private Long id;
    private String name;
    private Integer age;
    private String email;

    @Version  // mybatis-plus的注解，表示这是乐观锁
    private Integer version;

    @TableLogic  // 逻辑删除注解
    private Integer deleted;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
}
